﻿$.ajaxSetup({
    cache: false
});

//显示一个信息
function showMSG(MSG) {
    if ($("#thisPageMsg") != null) {
        $("#thisPageMsg").html("<p>" + MSG + "</p>");
        $("#thisPageMsg").dialog({
            modal: true,
            buttons: {
                确定: function () {
                    $(this).dialog("close");
                }
            }
        });
    }
}


//显示一个信息提示框
function alertMSG(messa) {
    var mdiv = "<div><i class='fa fa-info-circle fa-2x'></i> " + messa + "</div>";
    $(mdiv).dialog({
        resizable: false,
        autoOpen: true,
        modal: true,
        title: '消息框',
        //  closeOnEscape:true,
        buttons: {
            '关闭': function () {
                $(this).dialog('close');
            }
        }
    });
}


//显示一个确认框
function confirmMSG(messa, callback) {
    var mdiv = "<div><i class='fa fa-question-circle fa-2x'></i> " + messa + "</div>";
    $(mdiv).dialog({
        resizable: false,
        autoOpen: true,
        modal: true,
        title: '确认框',
        //  closeOnEscape:true,
        buttons: {
            '确定': function () {
                callback();
                $(this).dialog('close');
            },
            '取消': function () {
                $(this).dialog('close');
            }
        }
    });
}

/*
提示消息例子
confirmMSG('确认要删除吗？'，function(){
     $.ajax();
});
*/